<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>06-执行事件步骤</title>
    <style>
        div{
            width: 300px;
            height:300px;
            line-height: 30px;
            color : red;
            background-color: skyblue;
        }
    </style>
</head>
<body>
        <div>七里香</div>   
        
        <script>
            let div = document.querySelector('div');

            div.onclick = function(){
                console.log('为了部落，今晚吃鸡');
            }
            /* 
                绑定事件步骤：
                    1. 获取元素
                    2. 绑定函数，属性进行重新赋值
                    3. 编写函数，把具体的业务逻辑装到函数体
            */
        </script>
</body>
</html>